package com.hw.protocol.tool.config;

/**
 * @author : lihy
 * @date : 2024/3/12 14:09
 * description:
 */
public enum ProtocolType {

    HW("hw", "昊威协议"),
    HB("hb", "华北协议"),
    TX("tx", "天信协议"),
    JK("jk", "金卡协议"),
    NONE("", "未指定");

    private String name;

    private String label;

    ProtocolType(String name, String label) {
        this.name = name;
        this.label = label;
    }

    public String getName() {
        return name;
    }

    public String getLabel() {
        return label;
    }

    public static ProtocolType getByName(String name) {
        for (ProtocolType value : ProtocolType.values()) {
            if (value.name.equals(name)) {
                return value;
            }
        }
        return NONE;
    }
}
